<template>
	<div class="layout-padding">
		<div class="layout-padding-auto layout-padding-view">
			<el-row shadow="hover" v-show="showSearch" class="ml10">
				<el-form :model="queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList"> 
					<el-form-item label="文件检索" prop="inputId">
						<el-input style="width: 340px" placeholder="请输入关键词" v-model="inputId" />
					</el-form-item>
					<el-form-item>
						<el-button icon="search" style="background: #009678; color: #fff" @click="getDataList"> 查询 </el-button>
					</el-form-item>
				</el-form>
			</el-row>
			<el-row>
				<div class="mb8" style="width: 100%">
					<el-button icon="Download" style="background: #009678; color: #fff"> 下载 </el-button>
				</div>
			</el-row>
			<el-table
				:data="state.dataList"
				v-loading="state.loading"
				style="width: 100%"
				height="100%"
				stripe="true"
				:cell-style="tableStyle.cellStyle"
				:header-cell-style="tableStyle.headerCellStyle"
				@selection-change="handleSelectionChange"
			>
				<el-table-column type="selection" width="55" />
				<el-table-column prop="aaa" label="序号" width="55"></el-table-column>
				<el-table-column prop="bbb" label="类型"></el-table-column>
				<el-table-column prop="codeName" label="名称"></el-table-column>
				<el-table-column prop="ddd" label="日期"></el-table-column>
				<el-table-column prop="chargePeople" label="责任人"></el-table-column>
				<el-table-column label="操作" width="250">
					<template #default="scope">
						<el-button text type="primary" icon="View" style="color: #009678" @click="evaluateDialogRef.openDialog(scope.row)"> 查看 </el-button>
					</template>
				</el-table-column>
			</el-table>
			<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
		</div>
		<dialog-evaluate ref="evaluateDialogRef" @refresh="getDataList()" />
	</div>
</template>

<script setup lang="ts" name="auditKanban">
// 引入组件
const DialogEvaluate = defineAsyncComponent(() => import('./evaluate.vue'));
import { BasicTableProps, useTable } from '/@/hooks/table';
import { queryCodeReviewList } from '/@/api/codeReview/index';

// 定义变量内容
const queryRef = ref();
const evaluateDialogRef = ref();
const queryForm: any = ref({});
const showSearch = ref(true);
const inputId = ref('');
const state: BasicTableProps = reactive<BasicTableProps>({
	dataListLoading: false,
	createdIsNeed: false,
	queryForm: {
		data: {},
	},
	pageList: queryCodeReviewList,
});
const { getDataList, currentChangeHandle, sizeChangeHandle, tableStyle } = useTable(state);
const handleSelectionChange = (val: any) => {
	console.log(val);
};
</script>

<style lang="scss" scoped></style>
